// =============================================================================
// XPathDebugger And Examples SummaryCashFlow.cs
// Copyright (c) 2013 TNTTechnologies Inc.
// =============================================================================

#region

using System;
using System.Collections.Generic;
using System.Xml.Serialization;

#endregion

namespace Example{
    [Serializable]
    public class SummaryCashFlow{
        [XmlAttribute("paymentDate")]
        public DateTime PaymentDate { get; set; }

        [XmlAttribute("cashFlowReportingCurrency")]
        public double CashFlowReportingCurrency { get; set; }

        [XmlAttribute("PVCashFlowReportingCurrency")]
        public double PVCashFlowReporting { get; set; }

        #region Report Calculation Helpers

        public static double SumCashFlow(List<SummaryCashFlow> listReportItems){
            double result = 0;
            for (int i = 0; i < listReportItems.Count; ++i){
                result += listReportItems[i].CashFlowReportingCurrency;
            }
            return result;
        }

        public static double SumPVCashFlow(List<SummaryCashFlow> listReportItems){
            double result = 0;
            for (int i = 0; i < listReportItems.Count; ++i){
                result += listReportItems[i].PVCashFlowReporting;
            }
            return result;
        }

        #endregion
    }
}